import request from '@/utils/request'
// 获取部门
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}
// 删除部门
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
// 新增部门
// 注意:此处没有id,因为还没有新增
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}
// 获取部门详情
// 1.接口
export function getDeptDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}
// 组织架构-根据id修改部门详情
// 编辑部门
export function editDepartments(data) {
    return request({
      url: `/company/department/${data.id}`,
      method: 'put',
      data
    })
  }